home *** CD-ROM | disk | FTP | other *** search
/ 100 Great Games for Palm OS 2 / PalmV2012301.ISO / top100.dxr / 00008_Script_UI Rollover Change Member < prev    next >
Text File  |  2000-06-29  |  2KB  |  57 lines

  1. -- Rollover Change Member
  2.  
  3.  
  4. -- behavior library version 1.1
  5. -- a control
  6.  
  7. -- Display an alternate Image when mouse Pointer is over the sprite.
  8.  
  9. property  standardImage, alternateImage, nextCM
  10.  
  11. on mouseEnter me
  12.     puppetSound "swoosh2"
  13.   
  14.   set the member of sprite the spritenum of me = the alternateImage of me
  15. end  
  16.  
  17. on mouseLeave me
  18.   set the member of sprite the spritenum of me = the standardImage of me
  19. end
  20.  
  21. ---
  22.  
  23. on beginSprite me
  24.   set the standardImage of me = the member of sprite the spriteNum of me
  25.   
  26.   if nextCM = 1 then 
  27.     set memref = the member of sprite the currentspritenum
  28.     set castlibnum = the castlibnum of memref
  29.     set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
  30.     set alternateImage = memdefault
  31.   end if
  32.   
  33. end
  34.  
  35. on getPropertyDescriptionList
  36.   
  37.   
  38.   if the currentspritenum = 0 then 
  39.     set memdefault = 0 
  40.   else
  41.     set memref = the member of sprite the currentspritenum
  42.     set castlibnum = the castlibnum of memref
  43.     set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
  44.   end if
  45.   
  46.   
  47.   set p_list = [      #nextCM: [ #comment:   "Use Next Member:",                     #format:   #boolean,                    #default:    1 ],   #alternateImage: [ #comment:   "Rollover Cast Member:",                     #format:   #graphic,                    #default:    memdefault ]                  ]
  48.   return p_list
  49. end
  50.  
  51. on getBehaviorDescription
  52.   return "Change the sprite's cast member when the mouse rolls over the current sprite." & RETURN & "PARAMETERS:" & RETURN & "ò Use Next Member - Turn this option on to automatically display the next cast member in the cast when mouse rolls over the sprite."& RETURN & "ò Rollover Cast Member - Choose a specific cast member to appear when the mouse rolls over the sprite. This setting is ignored if Use Next Member is on."
  53.   
  54.   
  55. end
  56.  
  57.